<?
  $db_file = "foo.db3";  // Sqlite 檔案寫在這邊, 需用絕對路徑
  $dsn = "sqlite:".$db_file;

  try {
    echo $dsn."\n";
    $dbh = new PDO($dsn);
    //$res = $dbh->query("SELECT * FROM user ORDER BY uid LIMIT 0,1;");  // SQL指令寫這邊
    $res = $dbh->query("Select * From test");  // SQL指令寫這邊
    $row = $res->fetch(PDO::FETCH_ASSOC);
    print_r($row);
  } catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
  }
?>
